package com.daihou.utils;

import com.daihou.model.DHInterfaceAuth;

import java.util.Locale;
import java.util.ResourceBundle;

public class ConfigTingcui {
	private static ResourceBundle bundle = ResourceBundle.getBundle("app_Tingcui", Locale.CHINA);

	public static String getUrl(String name) {
		String address = bundle.getString("DaiHou_URL");
		String uri = "";
		String testUrl;
		//这里做个转换，把输入的 DAORU 转换为 daoru.uri
		String canshu = name.toLowerCase() + ".uri";
		uri = bundle.getString(canshu);
		testUrl = address + uri;
		return testUrl;
	}

	public static String getUrl(DHInterfaceAuth name) {
		String address = bundle.getString("DaiHou_URL");
		String uri = "";
		String testUrl;
		if (name == DHInterfaceAuth.AUTH) {
			uri = bundle.getString("auth.uri");
		}
		testUrl = address + uri;
		return testUrl;
	}

}
